<%@ page contentType= "text/html;charset=gb2312" %>

<html>
<%@ include file="../common/base.jsp" %>
<body>
<div id="container">
<%@ include file="../common/header.jsp" %>

	<div id="menu"> <a href="<c:url value="/common/home.o"/>"><fmt:message key="Home" /></a> > <fmt:message key="Role" />
	        <div  style="float: right" ><fmt:message key="Logged" />: <c:out value="${currentUser.username}" /> (<a href="<c:url value="/common/logout.o"/>"><fmt:message key="Logout" /></a>)</div>
	</div> 
	
	<div id="midbody">
	     <div id="leftside">
		 	<br>
		   	<a href="<c:url value="/role/manage.o"/>"><fmt:message key="AllRole" /></a>
		   	<br><br>
		   	<a href="<c:url value="/role/create.o"/>"><fmt:message key="CreateRole" /></a>
	     </div>
	     
	      <div id="rightside">
	         <div id="bigbox">
	           <div class="title clearfix">
	           		<div style="float: left"><fmt:message key="Role" /></div>
	           		<%@ include file="../common/hidemenu.jsp" %>
	           </div>
	           <div class="content">
		            <table id="manageRoles">
			            <tr>
			                <th><fmt:message key="Name" /></th>
			                <th><fmt:message key="Description" /></th>
			                <th><fmt:message key="Actions" /></th>
			            </tr>
			            <c:forEach var="role" items="${roles}">
			            <tr>
			                <td><c:out value="${role.name}" /></td>
			                <td><c:out value="${role.description}" /></td>
			                <td><a href="<c:url value="/role/edit.o?roleId=${role.id}"/>"><fmt:message key="Edit" /></a>
			                <c:if test="${role.name ne 'User' && role.name ne 'Admin'}">&nbsp;|&nbsp;
			                	<a href="<c:url value="/role/delete.o?roleId=${role.id}"/>"><fmt:message key="Delete" /></a>
			                </c:if>
			                </td>
			            </tr>
			            </c:forEach>
		        	</table>
	           </div>
	       </div>
	     </div>
	</div>
	
	<%@ include file="../common/foot.jsp" %>
</div>

</body>
</html>
